<h2>Products</h2>

<div *ngFor="let product of products;index as productId">

    <h3>
        <a [title]="product.name + ' details'" [routerLink]="['/products', productId]">
            {{ product.name }}
        </a>
    </h3>

    <p *ngIf="product.description">
        Description: {{ product.description }}
    </p>


    <button (click)="share()">
         Share
    </button>

    <!--prduct的值由父组件传给子组件-->
    <!--onNotify组件在子组件触发，传递给父组件-->
    <app-product-alerts
            (notify)="onNotify()"
            [product]="product">
    </app-product-alerts>




</div>
